﻿using SqlSugar;
using WebApplication4.Helper;
using Work3.Models;

namespace WebApplication4.Dao
{
    public class UserDao
    {
        public static SqlSugarClient DbContext = dbHelper.CretClient();
        public int Login(string username, string password)
        {
            var res = DbContext.Queryable<UserMsg>().Single(it => it.Username == username);
            if (res == null)
                return -1;
            else
                return res.Password == password ? 1 : 0;
        }
    }
}